Framework (A-Z)

Reference for Wiring version 1.0 Build 0100+ If you have a previous version, use the reference included with your software. If see any errors or have any comments, let us know.

Name

noPullup()

Examples
int inpin = 8;
int val = 0;
char ch;

void setup() {
  pinMode(WLED, OUTPUT);
  pinMode(inpin, INPUT); 
  Serial.begin(9600);
}

void loop() {
  // since the pin has the internal
  // pullup resistor enabled 
  // reading the pin with nothing attach to it will
  // return HIGH
  if (Serial.available() > 0) {
    ch = Serial.read();
    if (ch == 'p') {
      // since the pin has the internal
      // pullup resistor enabled 
      // reading the pin when disconnected will
      // return HIGH
      pullup(inpin);
    } 
    else {
      // since the pin has the internal
      // pullup resistor enabled 
      // reading the pin when disconnected will
      // return LOW or unstable readings
      noPullup(inpin);
    }
  }

  val = digitalRead(inpin);
  if (val == HIGH) 
  {
    digitalWrite(WLED, HIGH);
  } 
  else {
    digitalWrite(WLED, LOW);
  }
}
Description Pullup resistors are used in circuits to ensure that an input pin settle at an expected logical value (HIGH) when the pin is disconnected or high-impedance. The noPullup() method disables the internal pullup resistor on a pin on AVR core processors. By default the internal pullup is disabled.
Syntax
pullup(pin)
Parameters
pin pin number
Returns None
Usage Application
Related pullup()
INPUT
OUTPUT
pinMode()
digitalWrite()
digitalRead()
Updated on July 07, 2011 11:08:44pm PDT

Creative Commons License